import requests

# 通过请求接口，修改手机号，版本，包名模拟登录，用于测试抛包检查前的登录部分

# url = "http://test-ga.gmmega.xyz/net_account/login"    #  测试环境

login_url = "https://tpcash.site/api/ga-api/net_account/login"  # 正式环境
base_data = {
    "country": "IN",
    "mod": "CPH2247",
    "sys_vc": "33",
    "code": "4312",
    "gaid": "a38d8053-3134-4ff8-b7c8-9bd8d07bad11",
    "login_type": "in",
    "cou": "IN",
    "has_sim_card": "1",
    "language": "zh",
    "login_source": "phone",
    "sid": "1bbcc87b-ebcf-40f1-ad04-71bee5e3b771",
    "brd": "OPPO",
    "parent_code": "",
    "net": "wifi",
    "ftk": "fDC4tVF4RfiduzoXOLLgC1:APA91bEaoPWauH3b2CZL6p6PEBwVQP_ut9JGVzFPVOwjHrKn4PnQH7QwZbFVOs5_Tf_lhW8vFa7YcnKnKpXtmM0WaA1kJ-ZH4hoYNqyucXiKsF9DRnrHClE",
    "cha": "organic",
    "os": "33",
    "sim_mcc_mnc": "40420",
    "net_mid": "cpshare",
    "bucket": "96",
    "slan": "zh",
    "af_id": "1743056702752-6032878765644209982",
    "pf": "android",
    "sys_vn": "13",
    "aid": "567a67d8ffbff6ab",
    "did": "a38d8053-3134-4ff8-b7c8-9bd8d07bad11"

}

dynamic_params_list = [
    {"third_id": "910123400431", "pkg": "com.winmate.native", "verc": "1006000", "ver": "1.6.0", "apk_ver": "1.6.0"},
    {"third_id": "910123400432", "pkg": "com.winmate.ntshare", "verc": "1006000", "ver": "1.6.0", "apk_ver": "1.6.0"},
    {"third_id": "910123400433", "pkg": "com.winmate.native.fb", "verc": "1006000", "ver": "1.6.0", "apk_ver": "1.6.0"},
    {"third_id": "910123400434", "pkg": "com.winmate.ntshare.fb", "verc": "1006000", "ver": "1.6.0", "apk_ver": "1.6.0"},
    {"third_id": "910123400435", "pkg": "com.winmate.native.gg", "verc": "1006000", "ver": "1.6.0", "apk_ver": "1.6.0"},
    {"third_id": "910123400436", "pkg": "com.winmate.ntshare.gg", "verc": "1006000", "ver": "1.6.0", "apk_ver": "1.6.0"},
    # {"third_id": "910123400399", "pkg": "com.winmate.app", "verc": "1005009", "ver": "1.5.9", "apk_ver": "1.5.9"},
    {"third_id": "910123400437", "pkg": "com.winmate.appshare", "verc": "1006000", "ver": "1.6.0", "apk_ver": "1.6.0"},
]


data_list = []
for params in dynamic_params_list:
    merged_data = {**base_data, **params}
    data_list.append(merged_data)
print(data_list)

total = len(data_list)

for idx, data in enumerate(data_list, start=1):
    print(f"\n当前进度:{idx}/{total}")
    try:
        response = requests.post(login_url, json=data)
        print(f"✅请求成功：{data['third_id']},状态码：{response.status_code}, 响应：{response.json()}")
    except Exception as e:
        print(f"❌请求失败：{data['third_id']}，错误：{e}")


